package com.tc.zigbee.zcl.command;

import java.util.LinkedList;
import java.util.List;

import com.tc.util.DataUtil;

public class ConfigReportResponse extends AbstractZclCommand{
	public List<AttributeStatusRecord> getAttributes() {
		return attributes;
	}
	List<AttributeStatusRecord> attributes = new LinkedList<AttributeStatusRecord>();
	public ConfigReportResponse(byte[] data){

		int l = data.length/4;
		for(int i = 0; i < l; i++){
			AttributeStatusRecord r = new AttributeStatusRecord();
			r.status = data[4 * i];
			r.direction = data[4 * i + 1];
			byte[] buf = new byte[2];
			buf[0] = data[4 * i + 2];
			buf[1] = data[4 * i + 3];
			r.attribute = DataUtil.shortValue(buf);
			attributes.add(r);
		}
		
	}
}
class AttributeStatusRecord{
	byte status;
	byte direction;
	short attribute;
}